package com.coffee.admin.service.merchant.dao;

import com.coffee.admin.api.merchant.query.MerchantQuery;
import com.coffee.admin.service.merchant.bean.Merchant;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MerchantDao {
    public Merchant findById(Integer id);

    public Merchant findByOpenId(@Param("openId") String openId);

    public Merchant findByIdForUpdate(Integer id);

    public List<Merchant> findByIds(@Param("idList") List<Integer> idList);

    public List<Merchant> findByMobiles(@Param("mobileList") List<String> mobileList);

    public Integer count(@Param("param") MerchantQuery param);

    public List<Merchant> page(@Param("param") MerchantQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public List<Merchant> list(@Param("param") MerchantQuery param);

    public Integer getSupplierMerchantCount(@Param("param") MerchantQuery param);

    public List<Merchant> getSupplierMerchantPage(@Param("param") MerchantQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

    public Merchant findFirst(@Param("param") MerchantQuery param);

    public Integer insert(Merchant param);

    Integer insertBatch(List<Merchant> list);

    public void updateById(@Param("param") Merchant param);

    public Integer deleteById(Integer id);

    public Integer deleteByIds(List<Integer> idList);

    public Integer addIntegral(@Param("id") Integer id, @Param("integral") Integer integral);

    public Integer deleteIntegral(@Param("id") Integer id, @Param("integral") Integer integral);
    public Integer addBalance(@Param("id") Integer id, @Param("balance") Double balance);

    public Integer deleteBalance(@Param("id") Integer id, @Param("balance") Double balance);
}